package org.teamh.connection.handler;

import org.teamh.connection.json.handler.JsonConnectionHandler;
import org.teamh.game.Start;

public class JoinGameHandler extends MasterHandler {

	public JoinGameHandler(Start start) {
		super(start);
	}
	
	public boolean handleMsg(String line) {
		 if (line.startsWith("SENDING")&&line.contains("EVENTS")) {
//			 start.getConnection().getConnectionHandler().setInGame(false);
//			 
//			 jsonConnection = new JsonConnectionHandler(start, start.getLogic().getManager());
//			 start.getConnection().setJsonHandler(jsonConnection);
//			 jsonConnection.setInGame(true);
//			 jsonConnection.start();
			 
			 start.getConnection().setMessageReceiver(new JsonConnectionHandler(start, start.getLogic().getManager()));
			 
			 return true;
		 }
		 return false;
	}

}
	 

